﻿@*
    TicketDesk - Attribution notice
    Contributor(s):

         Stephen Redd (stephen@reddnet.net, http://www.reddnet.net)

    This file is distributed under the terms of the Microsoft Public
    License (Ms-PL). See http://opensource.org/licenses/MS-PL
    for the complete terms of use.

    For any distribution that contains code from this file, this notice of
    attribution must remain intact, and a copy of the license must be
    provided to the recipient.
*@

@using Microsoft.AspNet.Identity
@using TicketDesk.Domain.Model
@model IEnumerable<TicketEvent>

@foreach (var evt in Model.OrderByDescending(c => c.EventDate))
{
    var userId = User.Identity.GetUserId();
    
    var pnlType = (evt.EventBy == userId)? "panel-success": "panel-default";
    <div class="panel panel-default">
        <div class="panel-heading"  style="padding: 5px;">
            <div><strong>@evt.GetEventByInfo().DisplayName</strong> @evt.EventDescription</div>

            <div class="text-muted small" style="text-indent: 1em;">
                @evt.EventDate.Date.ToLongDateString()
                @evt.EventDate.Date.ToShortTimeString()
            </div>
        </div>
        @{
            var cmt = evt.HtmlComment();
            if (!string.IsNullOrEmpty(cmt.ToString()))
            {
                <div class="panel-body" style="padding: 5px;">@cmt</div>
            }
        }
    </div>
}
